﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using RESTRecursoService.Dominio;
using System.ServiceModel.Web;

namespace RESTRecursoService
{
    [ServiceContract]
    public interface IRecursos
    {
        //[WebGet(ResponseFormat = WebMessageFormat.Json)]
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "Recursos", ResponseFormat = WebMessageFormat.Json)]
        Recurso CrearRecurso(Recurso recursoACrear);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "Recursos/{codigo}", ResponseFormat = WebMessageFormat.Json)]
        Recurso ObtenerRecurso(string codigo);

        [OperationContract]
        [WebInvoke(Method = "PUT", UriTemplate = "Recursos", ResponseFormat = WebMessageFormat.Json)]
        Recurso ModificarRecurso(Recurso recursoAModificar);

        [OperationContract]
        [WebInvoke(Method = "DELETE", UriTemplate = "Recursos/{codigo}", ResponseFormat = WebMessageFormat.Json)]
        void EliminarRecurso(string codigo);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "Recursos", ResponseFormat = WebMessageFormat.Json)]
        List<Recurso> ListarRecursos();
    }
}
